##############################################################
#Figure D8: Variation in Risk $\rho_2$ Within ISCO1 Over Time
#Author: Raluca L. Pahontu
##############################################################

rho.occup <- read.dta13("risk_occup_distribution.dta")

ggplot(rho.occup,aes(x=year,y=toplot, color=toplot)) + 
  geom_point(size = 2) + scale_colour_gradient(low="green", high="red", name=expression(paste(Delta,rho, 2))) + facet_wrap(~occup1) + 
  geom_line(stat = "smooth", method = "loess",  span = .5, size = 2, alpha = 0.4) + 
  theme_bw() + ylab(" ") + xlab("Year") + ylim(-.3,0.3)  

ggsave("figure_d8.pdf")


